* ======================================
* ------------ Turnout knr -------------
* ======================================
* Creates a list of the 25 municipalities with complete voting records.


	use "$dta\Population.dta" , clear

	keep if year == 2015	
	drop if knr == "0712" | knr == "0710" 		// Larvik, Sandefjord (merged)

	gen zz = 1
	bysort knr: egen votepop2015 = total(zz)	// population by knr

	merge 1:1 idPers year using $dta\ImportTurnout.dta, nogen ///
		keep(matched master) 					// turnout in 2015
	
	gen record = 1*(vote != .)
	egen turnout_mt = total(record), by(knr year)
	gen popcoverage = turnout_mt / votepop2015

	keep if popcov > 0.9						// "full" coverage

	gen knr_inSample = 1
	collapse knr_inSample, by(knr)

	save "$dta\Turnout_knr.dta", replace
